﻿Public Class FormTasteometer
	Public prevForm As Form

	Private Sub ButtonGoBack_Click(sender As System.Object, e As System.EventArgs) Handles ButtonGoBack.Click
		Me.Close()
	End Sub

	Private Sub FormTasteometer_FormClosed(sender As Object, e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
		If Not IsNothing(prevForm) Then
			prevForm.Show()
			prevForm = Nothing
		End If
	End Sub

	Private Sub ButtonCalculate_Click(sender As System.Object, e As System.EventArgs) Handles ButtonCalculate.Click
		ProgressBarTasteometer.Value = 0
		LabelResult.Text = "Score: 0"""


		Dim methodCompare = New TasteometerCompare("artists", TextBoxArtistName1.Text, "user", My.Settings.user_name, "")
		methodCompare.sendRequest()
		Dim response = methodCompare.getResponse()

		Dim score As Double = response.score * 100.0

		ProgressBarTasteometer.Value = score
		LabelResult.Text = "Score: " + score.ToString()
	End Sub

	Private Sub FormTasteometer_Load(sender As Object, e As System.EventArgs) Handles Me.Load
		LabelResult.Text = "Score: "
	End Sub
End Class